package it.scambiocorse.model;

import it.scambiocorse.utils.Utils;

import java.beans.PropertyEditorSupport;

public class AutistaTypeEditor extends PropertyEditorSupport {

    private int idAutista;

    public void setIdAutista(int idAutista) {
		this.idAutista = idAutista;
	}

	public void setAsText(String text) {
        int id = 0;
		if (Utils.isValid(text)) {
            text = text.toUpperCase();
            id = Integer.parseInt(text);
        }
        AutistaType type = new AutistaType(id);
        setValue(type);
    }
}